package com.Logistics;

import com.Logistics.dto.OrderDto;
import com.Logistics.dto.Order_taskDto;
import com.Logistics.entity.Order;
import com.Logistics.mycommon.tools.Result;
import com.Logistics.vo.OrderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "pd-oms",path = "/order")
public interface OrderFeignClient {

    /**
     * 根据id获取订单详情
     * @param id 订单编号
     * @return 订单信息
     */
    @PostMapping("/CheckTheOrderBasedOnTheId")
    public OrderVo CheckTheOrderBasedOnTheId(@RequestParam("id") String id);

    /**
     * 根据多个订单id获取订单集合
     *
     * @param ids 订单Id
     * @return 订单详情
     */
    @PostMapping("/findById")
    public List<OrderVo> findById(@RequestParam("ids") List<String> ids) ;

    /**
     * 根据条件获取订单
     * @param orderDTO 条件
     * @return 订单
     */
    @PostMapping("/ObtainOrdersBasedOnConditions")
    public List<Order> ObtainOrdersBasedOnConditions(@RequestBody OrderDto orderDTO);

    /**
     * 修改订单信息
     * @param order
     * @return
     */
    @PostMapping("/updateOrder")
    public Result updateOrder(@RequestBody Order order);

    /**
     * 根据结束机构判断修改订单状态
     * @param orderdto 需要修改的订单信息
     */
    @PostMapping("/DetermineTheModificationOfOrderStatusBasedOnTheEndingInstitution")
    public void DetermineTheModificationOfOrderStatusBasedOnTheEndingInstitution(@RequestBody Order_taskDto orderdto);

    /**
     * 根据起点机构判断修改订单状态
     * @param
     */
    @PostMapping("/DetermineAndModifyTheOrderStatusBasedOnTheStartingOrganization")
    public void DetermineAndModifyTheOrderStatusBasedOnTheStartingOrganization(@RequestBody Order_taskDto orderdto);

}
